package com.s11.heap;

public class MaxHeapTest {

	public static void main(String[] args) {
		MaxHeap heap = new MaxHeap(8);
		System.out.println("----insert----");
		heap.insert(2);
		System.out.println(heap);

		heap.insert(3);
		heap.insert(7);
		heap.insert(5);
		heap.insert(6);
		System.out.println(heap);

		System.out.println("----removeMax----");
		heap.removeTop();
		System.out.println(heap);

		heap.removeTop();
		System.out.println(heap);

		heap.removeTop();
		System.out.println(heap);

		heap.removeTop();
		System.out.println(heap);

		heap.removeTop();
		System.out.println(heap);

		System.out.println("----buildHeap 1----");
		heap.clear();
		heap.copyOf(new int[] { 3, 1, 2 });
		heap.sort();
		System.out.println(heap);

		System.out.println("----buildHeap 2----");
		heap.clear();
		heap.copyOf(new int[] { 9, 6, 3, 1, 5 });
		heap.sort();
		System.out.println(heap);
	}

}
